<template>
  <div id="mine">
    <mt-header fixed title="个人中心" style="height: 0.64rem;"></mt-header>
    <div class="content">
      <div class="user-head">
        <!--<div class="user-img" @click="goMyInfo">-->
        <div class="profile">
          <img class="profile-image" :src="userProfileImg"/>
          <p class="profile-name">{{fullName}}</p>
        </div>
      </div>
      <!-- <div class="right-arrow" @click="goMyInfo">
         <img src="../assets/my/right.png" height="10" width="10"/>
       </div>-->
    </div>
    <div class="user-option">
      <mt-cell is-link>
        <span slot="title">设置</span>
        <img slot="icon" src="../assets/my/setting.png" width="20" height="20">
      </mt-cell>
      <mt-cell >
        <span slot="title" @click="aboutInfoClick">关于</span>
        <span >当前版本V1.0</span>
        <img slot="icon" src="../assets/my/info.png" width="20" height="20">
      </mt-cell>

    </div>
    <div class="logout-box">
      <mt-button class="mint-button--danger btn-logout" @click="logOut()">退出登录</mt-button>
    </div>
  </div>
</template>


<script>
  export default {
    data() {
      return {
      }
    },
    methods: {
      goMyInfo() {
        this.$router.push('/mine/myinfo');
      },
      logOut() {
        this.$store.dispatch('logout');
      },
      aboutInfoClick(){
        console.log('aboutInfoClick');
        this.$router.push("/mine/about");
      }
    },
    computed: {
      userProfileImg() {
        return this.$store.state.userProfile.imageUrl
      },
      fullName() {
        return this.$store.state.userProfile.fullName
      }
    },
    created() {
      let _footer = this.$store.state.footerVisible;
      if (!_footer) {
        this.$store.commit('TOGGLE_FOOTER');
      }
      this.$store.commit('SELECT_TAB', 'mine')
    }

  }
</script>

<style scoped>

  .content {
    margin-top: 0.64rem;
    display: flex;
    flex-direction: column;
  }

  .user-head {
    height: 1.4rem;
    width: 100%;
    background-color: #73ccff;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .user-img {
    background-image: url("../assets/my/user.png");
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 0.3rem;
    border: solid #ffffff 0.02rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .user-option {
    background-color: #dbdbdb;
    margin-left: 0.15rem;
    margin-right: 0.15rem;
  }

  .mint-cell {
    min-height: 0.4rem;
  }

  .right-arrow {
    margin-left: 0.1rem;
  }

  .user-option span {
    font-size: 0.13rem;
  }

  .mint-cell:last-child {
    background-position-x: 0.1rem;
  }

  .logout-box {
    margin-top: 0.4rem;
    text-align: center
  }

  .btn-logout {
    width: 2rem;
  }

  .profile{}
  .profile img{display:flex;border-radius: 50% 50%;}
  .profile-image{width:0.64rem;height:0.64rem;}
  .profile-name{margin-top:0.05rem;margin-bottom:0.05rem;text-align: center;font-size:0.16rem;}
</style>
